package cn.zwy.service.jdkproxy;

import java.lang.reflect.Proxy;

import cn.zwy.service.UserService;
import cn.zwy.service.UserServiceImpl;

public class JDKProxyTest {
    public static void main(String[] args) throws Exception {
        JDKProxy handler = new JDKProxy(new UserServiceImpl());
        UserService proxy = (UserService) Proxy.newProxyInstance(UserService.class.getClassLoader(),
                new Class[] { UserService.class }, handler);
        proxy.add();
    }
}
